/**
 * 
 */
package com.rst.doc.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.rst.common.domain.CommonDetailsTable;

/**
 * @author JavaDeamon
 *
 */
@Entity
@Table(name="DOCUMENT_FLOW_DETAILS")
public class DocumentFlowDetailsDTO extends CommonDetailsTable implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6502471173983270189L;
	public enum DocumentFlowStatus {
		PFS, //Pending for Submission
		PFR, //Pending for Reveiw
		PFA, //Pending for approval
		PFRS, //Pending for RE Submission
		PFRR, //Pending for RE Reveiw
		PFRA, //Pending for  RE approval
		TBR, // To be Renewed
		PFRW, // pending for renewal
	}
	public enum DocumentEventStatus {
		OPEN,		//If document flow is in progress
		CLOSED,		//If document flow is ended
		SUSPENDED,	//If document flow is left incomplete for <user_defined> days
		ARCHIVED	//If document flow is complete and it is active in the system
	}
	
	private Long flowId;
	private Long documentId;
	private DocumentFlowStatus documentFlowStatus;
	private DocumentEventStatus documentEventStatus;
	private String assignedUser;
	private String flowCompleteDesc;
	
	/**
	 * @return the flowId
	 * primary key
	 * contains autogenerated id
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="FLOW_ID")
	public Long getFlowId() {
		return flowId;
	}
	/**
	 * @return the documentId
	 * contains the document id for which the flow details are mentioned
	 * cannot be null
	 */
	@Column(name="DOCUMENT_ID", nullable=false)
	public Long getDocumentId() {
		return documentId;
	}
	/**
	 * @return the documentFlowStatus
	 * contains the flow status
	 * having value from one of the enums stated above
	 * cannot be null
	 */
	@Column(name="DOCUMENT_FLOW_STATUS", nullable=false)
	public DocumentFlowStatus getDocumentFlowStatus() {
		return documentFlowStatus;
	}
	/**
	 * @return the documentEventStatus
	 * contains the event status
	 * having value from one of the enums stated above
	 * cannot be null
	 */
	@Column(name="DOCUMENT_EVENT_STATUS", nullable=false)
	public DocumentEventStatus getDocumentEventStatus() {
		return documentEventStatus;
	}
	/**
	 * @return the assignedUser
	 * contains the userId of the assigned user for the document flow status
	 * length is 30
	 */
	@Column(name="FLOW_ASSIGNED_USER", length=30)
	public String getAssignedUser() {
		return assignedUser;
	}
	/**
	 * @return the flowCompleteDesc
	 * contains the description given at the end of each flow state
	 * cannot be null
	 * length is 300
	 */
	@Column(name="FLOW_DESCRIPTION", nullable=false, length=300)
	public String getFlowCompleteDesc() {
		return flowCompleteDesc;
	}
	/**
	 * @param flowId the flowId to set
	 */
	public void setFlowId(Long flowId) {
		this.flowId = flowId;
	}
	/**
	 * @param documentId the documentId to set
	 */
	public void setDocumentId(Long documentId) {
		this.documentId = documentId;
	}
	/**
	 * @param documentFlowStatus the documentFlowStatus to set
	 */
	public void setDocumentFlowStatus(DocumentFlowStatus documentFlowStatus) {
		this.documentFlowStatus = documentFlowStatus;
	}
	/**
	 * @param documentEventStatus the documentEventStatus to set
	 */
	public void setDocumentEventStatus(DocumentEventStatus documentEventStatus) {
		this.documentEventStatus = documentEventStatus;
	}
	/**
	 * @param assignedUser the assignedUser to set
	 */
	public void setAssignedUser(String assignedUser) {
		this.assignedUser = assignedUser;
	}
	/**
	 * @param flowCompleteDesc the flowCompleteDesc to set
	 */
	public void setFlowCompleteDesc(String flowCompleteDesc) {
		this.flowCompleteDesc = flowCompleteDesc;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "DocumentFlowDetailsDTO [flowId=" + flowId + ", documentId="
				+ documentId + ", documentFlowStatus=" + documentFlowStatus
				+ ", documentEventStatus=" + documentEventStatus
				+ ", assignedUser=" + assignedUser + "]";
	}
}
